<template>
  <!-- 顶部导航 -->
  <div class="nav-bar-box">
    <transition name="nav">
      <div class="nav-bg" v-show="showNav"></div>
    </transition>
    <div class="nav-bar">
      <div class="back" @click="$router.back()">
        <img src="@/assets/arrow/ll.png" />
      </div>
      <div class="icon">
        <img src="@/assets/head/-l1.png" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    showNav: Boolean
  }
}
</script>

<style lang="less" scoped>
.nav-bar-box {
  .nav-bar {
    top: 0;
    left: 0;
    z-index: 11;
    height: 40px;
    width: 100vw;
    display: flex;
    padding: 0 10px;
    position: fixed;
    align-items: center;
    justify-content: space-between;
    background-color: transparent;
    .back,
    .icon {
      height: 30px;
      width: 30px;

      &.back {
        height: 20px;
        width: 20px;
        transform: rotateZ(180deg);
      }

      img {
        height: 100%;
        width: 100%;
      }
    }
  }

  .nav-bg {
    top: 0;
    left: 0;
    z-index: 10;
    height: 40px;
    width: 100vw;
    position: fixed;
    background-color: #4a4a4a;
  }

  .nav-enter,
  .nav-leave-to {
    transform: translateY(-100%);
  }
  .nav-enter-active,
  .nav-leave-active {
    transition: all 0.3s linear;
  }
  .nav-enter-to,
  .nav-leave {
    transform: translateY(0%);
  }
}
</style>
